package Demo01;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28463
 * Date: 2022—06—22
 * Time: 15:37
 */
class Message<T> {
    private T message ;

    public T getMessage() {
        return message;
    }

    public void setMessage(T message) {
        this.message = message;
    }
}

public class Test02 {
    public static void main(String[] args) {
        Message<String> message = new Message() ;
        message.setMessage("xawl");
        fun(message);

        Message<Integer> message2 = new Message() ;
        message2.setMessage(10);
        fun(message2);
    }

    public static void fun(Message<?> temp){
        System.out.println(temp.getMessage());
    }
}
